home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / C / ASAP / colormap.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-09-08  |  5.1 KB  |  123 lines

  1. /*****************************************************************************
  2.  *                                                                           *
  3.  * ASAP - Amiga Software Authoring Platform                                  *
  4.  *                                                                           *
  5.  * Written by Laurie Perrin                                                  *
  6.  *                                                                           *
  7.  * AColorMap wrapper class                                                   *
  8.  *                                                                           *
  9.  *****************************************************************************/
  10.  
  11. #ifndef ASAP_ColorMap_H
  12. #define ASAP_ColorMap_H
  13.  
  14. #include <New.h>
  15.  
  16. extern "C"
  17. {
  18.  #include <Proto/Graphics.h>
  19. }
  20.  
  21. class AColorMap : public ColorMap
  22. {
  23.  public:
  24.  inline LONG AttachPalExtra(struct ViewPort * vp);
  25.  inline LONG FindColor(unsigned long r, unsigned long g, unsigned long b, long maxcolor);
  26.  inline void FreeColorMap();
  27.  inline void operator delete(void *);
  28.  inline static AColorMap * GetColorMap(long entries);
  29.  inline void * operator new (size_t, long entries);
  30.  inline void GetRGB32(unsigned long firstcolor, unsigned long ncolors, ULONG * table);
  31.  inline ULONG GetRGB4(long entry);
  32.  inline LONG ObtainBestPen(unsigned long r, unsigned long g, unsigned long b, unsigned long tag1Type,  ...);
  33.  inline LONG ObtainBestPenA(unsigned long r, unsigned long g, unsigned long b, struct TagItem * tags);
  34.  inline ULONG ObtainPen(unsigned long n, unsigned long r, unsigned long g, unsigned long b, long f);
  35.  inline void ReleasePen(unsigned long n);
  36.  inline void SetRGB32CM(unsigned long n, unsigned long r, unsigned long g, unsigned long b);
  37.  inline void SetRGB4CM(long index, unsigned long red, unsigned long green, unsigned long blue);
  38.  inline BOOL VideoControl(struct TagItem * tagarray);
  39.  inline BOOL VideoControlTags(unsigned long tag1Type,  ...);
  40. };
  41. //----------------------------------------------------------------------------
  42. LONG AColorMap::AttachPalExtra (ViewPort * vp)
  43. {
  44.  return ::AttachPalExtra(this, vp);
  45. }
  46. //----------------------------------------------------------------------------
  47. LONG AColorMap::FindColor (unsigned long r, unsigned long g, unsigned long b, long maxcolor)
  48. {
  49.  return ::FindColor(this, r, g, b, maxcolor);
  50. }
  51. //----------------------------------------------------------------------------
  52. void AColorMap::FreeColorMap ()
  53. {
  54.  ::FreeColorMap(this);
  55. }
  56. //----------------------------------------------------------------------------
  57. void AColorMap::operator delete (void *colorMap)
  58. {
  59.  ((AColorMap *) colorMap)->FreeColorMap();
  60. }
  61. //----------------------------------------------------------------------------
  62. AColorMap * AColorMap::GetColorMap (long entries)
  63. {
  64.  return (AColorMap *) ::GetColorMap(entries);
  65. }
  66. //----------------------------------------------------------------------------
  67. void * AColorMap::operator new (size_t, long entries)
  68. {
  69.  return AColorMap::GetColorMap(entries);
  70. }
  71. //----------------------------------------------------------------------------
  72. void AColorMap::GetRGB32 (unsigned long firstcolor, unsigned long ncolors, ULONG * table)
  73. {
  74.  ::GetRGB32(this, firstcolor, ncolors, table);
  75. }
  76. //----------------------------------------------------------------------------
  77. ULONG AColorMap::GetRGB4 (long entry)
  78. {
  79.  return ::GetRGB4(this, entry);
  80. }
  81. //----------------------------------------------------------------------------
  82. LONG AColorMap::ObtainBestPen (unsigned long r, unsigned long g, unsigned long b, unsigned long tag1Type,  ...)
  83. {
  84.  return AColorMap::ObtainBestPenA(r, g, b, (TagItem *) tag1Type);
  85. }
  86. //----------------------------------------------------------------------------
  87. LONG AColorMap::ObtainBestPenA (unsigned long r, unsigned long g, unsigned long b, struct TagItem * tags)
  88. {
  89.  return ::ObtainBestPenA(this, r, g, b, tags);
  90. }
  91. //----------------------------------------------------------------------------
  92. ULONG AColorMap::ObtainPen (unsigned long n, unsigned long r, unsigned long g, unsigned long b, long f)
  93. {
  94.  return ::ObtainPen(this, n, r, g, b, f);
  95. }
  96. //----------------------------------------------------------------------------
  97. void AColorMap::ReleasePen (unsigned long n)
  98. {
  99.  ::ReleasePen(this, n);
  100. }
  101. //----------------------------------------------------------------------------
  102. void AColorMap::SetRGB32CM (unsigned long n, unsigned long r, unsigned long g, unsigned long b)
  103. {
  104.  ::SetRGB32CM(this, n, r, g, b);
  105. }
  106. //----------------------------------------------------------------------------
  107. void AColorMap::SetRGB4CM (long index, unsigned long red, unsigned long green, unsigned long blue)
  108. {
  109.  ::SetRGB4CM(this, index, red, green, blue);
  110. }
  111. //----------------------------------------------------------------------------
  112. BOOL AColorMap::VideoControl (struct TagItem * tagarray)
  113. {
  114.  return ::VideoControl(this, tagarray);
  115. }
  116. //----------------------------------------------------------------------------
  117. BOOL AColorMap::VideoControlTags (unsigned long tag1Type,  ...)
  118. {
  119.  return AColorMap::VideoControl((TagItem *) tag1Type);
  120. }
  121.  
  122. #endif
  123.